import request from '@/utils/request'

//后台登录
export function login(data) {
  return request({
    url: '/admin/managerlogin',
    method: 'post',
    data
  })
}

//后台登录验证码
export function captcha(query) {
  return request({
    url: '/admin/captcha',
    method: 'get',
    params: { query }
  })
}

//获得管理员账号信息
export function getInfo(query) {
  return request({
    url: '/admin/managerinfo',
    method: 'get',
    params: { query }
  })
}

//上传头像
export function uploadavatar(data) {
  return request({
    url: '/admin/adminuploadavatar',
    method: 'post',
    data
  })
}

//保存账号信息
export function saveaccount(data) {
  return request({
    url: '/admin/adminsaveaccount',
    method: 'post',
    data
  })
}

//修改账号密码
export function resetpassword(data) {
  return request({
    url: '/admin/adminresetpassword',
    method: 'post',
    data
  })
}

//权限
export function authmenulist(query) {
  return request({
    url: '/admin/authmenulist',
    method: 'get',
    params: { query }
  })
}

//退出登录
export function logout() {
  return request({
    url: '/admin/logout',
    method: 'post'
  })
}
